<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="user-scalable=no, initial-scale = 1, minimum-scale = 1, maximum-scale = 1, width=device-width" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<title>Dashboard</title>
	<link rel="shortcut icon" href="../../static/images/favicon.png">
	<link rel="stylesheet" href="../../static/stylesheets/app.css">
	<script src="../../static/scripts/library.js"></script>
	<script src="../../static/scripts/app.js"></script>
	<script src="../../static/scripts/initialize.js"></script>
</head>
<body class="">
	<div id="header">
		<ul class="con">
			<li class="uplink dashboard">
				<a href="home">Dashboard</a>
			</li>
			<li class="uplink count indicator">
				<span data-count="{{notif.count}}">Notificaciones</span>
				<ul>
					{%for notification in notif%}
					<li>
						<a href="{{STATIC_URL}}demo/ajax.html" data-modal>
							<h4>{{notification.id_usuario}}</h4>
							<p>{{notification.descripcion_notificacion}}</p>
						</a>
					</li>
					{%endfor%}
				</ul>
			</li>
			<li class="uplink messages">
				<span>Messages</span>
				<ul>
					<!--li class="unread">
						<a href="../../static/demo/ajax.html" data-modal>
							<img class="avatar" src="{{STATIC_URL}}demo/avatar.jpg" alt="avatar" />
							<h4>Jens Alba</h4>
							<p>Lorem ipsum dolor sit imet smd ddm lksdm lkdsm</p>
						</a>
					</li>
					<li>
						<a href="{{STATIC_URL}}demo/ajax.html" data-modal>
							<img class="avatar" src="{{STATIC_URL}}demo/boy_avatar.jpg" alt="avatar" />
							<h4>Jens Alba</h4>
							<p>Lorem ipsum dolor sit imet smd ddm lksdm lkdsm</p>
						</a>
					</li>
					<li>
						<a href="{{STATIC_URL}}demo/ajax.html" data-modal>
							<img class="avatar" src="{{STATIC_URL}}demo/avatar92.jpg" alt="avatar" />
							<h4>Jens Alba</h4>
							<p>Lorem ipsum dolor sit imet smd ddm lksdm lkdsm</p>
						</a>
					</li-->
				</ul>
			</li>

			<li id="logo">
				hanabi
			</li>
			<li class="avatar">
				<img src="../../static/{{user.avatar}}" alt="avatar" />
				<ul>
					<li>
						<a href="#">
							<h4>{{user.first_name}} {{user.last_name}}</h4>
							<p>Editar mi perfil</p>
						</a>
					</li>
					<li>
						<a rel="external" href="loggout">
							<h4>Cerrar Sesión</h4>
							<p>Volver al inicio de sesión</p>
						</a>
					</li>
				</ul>
			</li>
			<li class="search">
				<input type="text" placeholder="Search" />
				<ul>
					<li>
						<a href="#">
							<h4>Jens Alba</h4>
							<p>Lorem ipsum dolor sit imet smd ddm lksdm lkdsm</p>
						</a>
					</li>
					<li>
						<a href="#">
							<h4>Jens Alba</h4>
							<p>Lorem ipsum dolor sit imet smd ddm lksdm lkdsm</p>
						</a>
					</li>
					<li>
						<a href="#">
							<h4>Jens Alba</h4>
							<p>Lorem ipsum dolor sit imet smd ddm lksdm lkdsm</p>
						</a>
					</li>
				</ul>
			</li>
		</ul>
	</div>
	<div id="stream">
		<div class="con">
			<div class="tile" id="hello">
				<h2><span>Hola, </span>{{user.first_name}}</h2>
				<p>Última visita: <strong>{{user.last_login}}</strong></p>
				<ul class="nav">
					<li>
						<a rel="external" href="/dashboard/#home">*</a>
					</li>
					{%for option in options%}
					<li>
						<a href="#{{option.dir}}" id="{{option.id}}">{{option.icon}} <span class="action">{{option.action}}</span></a>
					</li>
					{%endfor%}
				</ul>
			</div>

			<script type="text/javascript">
				$('#addarticle').bind("tap",function(){
					$.editor("../../static/demo/editor.txt", "#editor-textarea", "#editor-preview");
					$.change("#editor");
				});
				// $('#upd8article').bind("tap",function(){
				// 	$.editor(undefined, "#editor-utextarea", "#editor-upreview","");
				// 	$.change("#aedit");
				// });
			</script>

			<a class="tile" rel="external" href="users#user_stats">
				<span class="vector">f</span>
				<span class="title"><strong>Usuarios</strong></span>
				<span class="desc"><strong>Administrar</strong> </span>
			</a>
			<a class="tile" rel="external" href="articles#article_stats">
				<span class="vector">C</span>
				<span class="title"><strong>articulos</strong></span>
				<span class="desc"><strong>administrar</strong> </span>
			</a>

			<a class="tile" rel="external" href="forums#forum_stats">
				<span class="vector">"</span>
				<span class="title"><strong>foros</strong></span>
				<span class="desc"><strong>administrar</strong> </span>
			</a>
		</div>
	</div>
	<div id="dashboard">
		<div class="scroll con">
			<div class="section current" title="Inicio - Dashboard" id="home">
				<div class="row widgets">
					<div id="orbiting" class="col thirty pin">
						<div class="content">
							<div class="heading">
								<h4><span>Justo</span> ahora?</h4>
								<span>Estadisticas en tiempo real</span>
							</div>
							<div class="wrapper">
								<ul class="orbit-chart animated flipInX">
									<li class="one"><span><a href="#"></a></span></li>
									<li class="two"><span><a href="#"></a></span></li>
									<li class="three"><span><a href="#"></a></span></li>
									<li class="four"><span><a href="#"></a></span></li>
								</ul>
							</div>
						</div>
					</div>
					<div id="graph" class="col thirty">
						<div class="content">
							<div class="heading">
								<h4><span>La semana</span> pasada</h4>
								<span>Estadisticas</span>
							</div>
							<div class="wrapper padding">
								<div id="chart1"></div>
							</div>
						</div>
					</div>
					<div id="tasks" class="col fourty last">
						<div class="content">
							<div class="heading">
								<h4><span>To-do</span> list</h4>
								<span>There's a third dimension</span>
							</div>
							<div class="wrapper" style="left: 1px; right: 1px; top: 141px; bottom: 0px;">
								<ul>
									<li class="layer">
										<ul>
											<li class="todo checked">Agregar un articulo sobre python</li>
											<li></li>
										</ul>
									</li>
									<li class="layer">
										<ul>
											<li class="todo unchecked">Activar nuevas cuentas</li>
											<li></li>
										</ul>
									</li>
									<li class="layer">
										<ul>
											<li class="todo unchecked">Limpiar foros inactivos</li>
											<li></li>
										</ul>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="section padding" title="Estadísticas Usuarios - Dashboard" id="user_stats">
				<form id="selectUser" action="getUser">
					<input id="uid" type="hidden" name="uid"/>
				</form>
				<ul class="tabs">
					<li id="utablelink" class="count current">
						<a href="#utable" data-count="{{users.count}}">Total de usuarios</a>
					</li>
					<li class="count">
						<a href="#rtable" data-count="{{recents.count}}">Usuarios recientes</a>
					</li>
					<li class="count">
						<a href="#atable" data-count="{{active.count}}">Usuarios Activos</a>
					</li>
					<li class="count">
						<a href="#itable" data-count="{{inactive.count}}">Usuarios No Activos</a>
					</li>
					<li class="count">
						<a href="#admintable" data-count="{{admins.count}}">Administradores</a>
					</li>
					<li class="count">
						<a href="#membertable" data-count="{{members.count}}">Miembros {{renderquery}}</a>
					</li>
					<li id="qtablelink">
						<a href="#search">Buscar</a>
					</li>
					{%if renderquery%}
					<script type="text/javascript">
					$("#utablelink").removeClass("current");
					$("#qtablelink").addClass("current");
					</script>
					{%endif%}
				</ul>
				<div class="tabs">
					<div id="utable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th></th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in users%}
								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="rtable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th></th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in recents%}
								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="atable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th></th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in active%}

								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="itable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th></th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in inactive%}

								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="admintable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th></th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in admins%}

								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="membertable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th></th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in members%}

								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="search" class="tab padding">

						<form id="queryform" action="user_query/" method="POST">
							<table>
								<thead>
									<tr>
										<th style="width: 80px">
											<select name="id_condition">
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 100px">
											<select>
												<option>Nombre</option>
												<option>Apellido</option>
												<option selected="selected">Nombre y Apellido</option>
											</select>
										</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 200px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th>Admin</th>
										<th>Activo</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>
											<input class="query" type="text" name="uid" placeholder="ID"/>
										</td>
										<td style="width:20%;">
											<input class="query" type="text" name="firstname" placeholder="Nombre"/>
										</td>
										<td>
											<input class="query" type="text" name="username" placeholder="Username"/>
										</td>
										<td>
											<input class="query" type="text" name="email" placeholder="Email"/>
										</td>
										<td>
											<input class="query" type="text" name="phone" placeholder="Teléfono"/>
										</td>
										<td>
											<input type="checkbox"/>
										</td>
										<td>
											<input type="checkbox"/>
										</td>
										<td>

										</td>
									</tr>
								</tbody>
							</table>
							<input class="query" id="date" type="text" style="width:100px; float:right; margin-top:-40px; margin-right:10px;" placeholder="Fecha registro"/>
							<input class="runquery"  type="submit" value="Buscar" id="submit"/>
						</form>

						<button id="hide" is-hidden="no" >
							<img id="toggle" src="../../static/images/toggleA.png">
						</button>

						<script type="text/javascript">
						$("#hide").click(function(){
							$("#queryform").delay(200).slideToggle();
							if($(this).attr("is-hidden")=='yes'){
								$(this).attr("is-hidden","no");
								$("#toggle").attr("src","../../static/images/toggleA.png");
							}else{
								$("#toggle").attr("src","../../static/images/toggleB.png");
								$(this).attr("is-hidden","yes");
							}
						});
						</script>

						<table>
							<thead>
								<tr>
									<th></th>
									<th>ID</th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in queryset%}
								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitX" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td>{{user.id}}</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
								<script>
								$("a.submitX").click(function() {
									$("#uid").attr("value",$(this).attr("uid"))
									$("form#selectUser").submit();
								});
								</script>
							</tbody>
						</table>

					</div>
				</div>
			</div>
			<div class="section padding" title="Agregar Usuarios - Dashboard" id="add_user">
				<div id="misc" class="tab padding">
					<div class="carton container border">
						<div class="column">
							<div class="content">
								<h2 class="infobox glyph persons">Agregar un nuevo usuario</h2>
								<form enctype="multipart/form-data" id="demo" class="content" action="addUser/" method="POST">
									<p class="combine">
										<input id="firstname" name="firstname" type="text" placeholder="Nombres" />
										<input type="text" name="lastname"placeholder="Apellidos" />
									</p>
									<p>
										<input id="username" name="username" type="text" placeholder="Username" />
									</p>
									<p>
										<input id="key" name="password" type="password" placeholder="Password" />
									</p>
									<p>
										<input id="email" name="email" type="text" placeholder="email" />
									</p>
									<p>
										<input id="phone" type="text" name="phone" placeholder="Teléfono" />
									</p>
									<p>
										<select id="country" name="country" placeholder="País" />>
											{%for country in countries%}
												<option>{{country.nombre_lugar}}</option>
											{%endfor%}
										</select>
									</p>
									<p>
										<input type="file" name="avatar" data-text="avatar" />
									</p>
									<p class="combine">
										<input type="checkbox" name="admin" class="grey" />
										<label style="margin-right:20px">Administrador</label>
										<input type="checkbox" name="active" class="grey" />
										<label>Activo</label>
									</p>
									<input class="lime" type="submit" value="Agregar" />
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="section padding" title="Editar Usuarios - Dashboard" id="edit_user">
				<div id="misc" class="tab padding">
					<div class="carton container border">
						<div class="column">
							<div class="content">
								{%if uedit%}
								<form action="deleteEditingUser/">
									<h2 class="infobox glyph persons">
										Editar el usuario: {{uedit.username}} (id {{uedit.id}})
										<input type="submit" value="Cancelar" class="cancel"/>
									</h2>
								</form>
								<form enctype="multipart/form-data" id="update" class="content" action="updateUser/" method="POST">
									<input type="hidden" value="{{uedit.id}}" name="uid"/>
									<p class="combine">
										<input id="edfirstname" name="firstname" type="text" value="{{uedit.first_name}}" />
										<input type="text" name="lastname" value="{{uedit.last_name}}" />
									</p>
									<p>
										<input id="edkey" name="password" type="password" placeholder="password"/>
									</p>
									<p>
										<input id="edemail" name="email" type="text" value="{{uedit.email}}" />
									</p>
									<p>
										<input id="edphone" type="text" name="phone" value="{{uedit.phone}}" />
									</p>
									<p>
										<select id="edcountry" name="country" placeholder="País" />>
											{%for country in countries%}
												{%ifequal country.id_lugar uedit.origen%}
												<option selected="true">{{country.nombre_lugar}}</option>
												{%else%}
												<option>{{country.nombre_lugar}}</option>
												{%endifequal%}
											{%endfor%}
										</select>
									</p>

									<span class="utable" style="float:left; margin-top:-10px;">
										<ul>
											<li class="avatar"><img src="../../static/{{uedit.avatar}}" alt="avatar"/></li>
										</ul>
									</span>


									<p style="width:90%; float:right;">
										<input type="file" name="avatar" data-text="avatar" />
									</p>
									<p class="combine" style="text-align:center; margin-top:50px;">
										{% if uedit.is_superuser%}
										<input  checked="true" type="checkbox" name="admin" class="grey" />
										{%else%}
										<input  type="checkbox" name="admin" class="grey" />
										{%endif%}
										<label style="margin-right:20px">Administrador</label>
										{% if uedit.is_superuser%}
										<input  checked="true" type="checkbox" name="active" class="grey" />
										{%else%}
										<input  type="checkbox" name="active" class="grey" />
										{%endif%}
										<label>Activo</label>
									</p>
									<br/>
									<p>
										<input class="lime" type="submit" value="Actualizar" />
									</p>
								</form>
								{%else%}
								<p class="infobox glyph warning">
									Para editar un usuario da clic en el avatar del usuario
									<img class="shadow-pic" src="../../static/images/user_help.png"/>
								</p>
								{%endif%}
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="section padding" title="Estadísticas Artículos - Dashboard" id="article_stats">
				<form id="selectArticle" action="getArticle">
					<input id="aid" type="hidden" name="aid"/>
				</form>
				<ul class="tabs">
					<li id="utablelink" class="count current">
						<a href="#atable" data-count="{{articles.count}}">Total de Articulos</a>
					</li>
					<li class="count">
						<a href="#ratable" data-count="{{recents.count}}">Articulos recientes</a>
					</li>
					<li class="count">
						<a href="#ptable" data-count="{{published.count}}">Articulos Publicados</a>
					</li>
					<li class="count">
						<a href="#uptable" data-count="{{unpublished.count}}">Articulos No Publicados</a>
					</li>
					<li id="qtablelink">
						<a href="#search">Buscar</a>
					</li>
					{%if renderquery%}
					<script type="text/javascript">
					$("#utablelink").removeClass("current");
					$("#qtablelink").addClass("current");
					</script>
					{%endif%}
				</ul>
				<div class="tabs">
					<div id="atable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Hits</th>
									<th style="width: 200px">Comentarios</th>
									<th style="width: 200px">Fecha creación</th>
								</tr>
							</thead>
							<tbody>
								{%for article in articles%}
								<tr>
									<td>
										{{article.id_publicacion}}
									</td>
									<td>
										<a class="submitA" rel="external" href="#" aid="{{article.id_publicacion}}">
											{{article.titulo}}
										</a>
									</td>
									{% if article.estado_publicacion%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{article.id_usuario}}</td>
									<td>{{article.hits}}</td>
									<td>{{article.comments_count}}</td>
									<td>{{article.fecha_publicacion}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="ratable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Hits</th>
									<th style="width: 200px">Comentarios</th>
									<th style="width: 200px">Fecha creación</th>
								</tr>
							</thead>
							<tbody>
								{%for article in recents%}
								<tr>
									<td>
										{{article.id_publicacion}}
									</td>
									<td>
										<a class="submitA" rel="external" href="#" aid="{{article.id_publicacion}}">
											{{article.titulo}}
										</a>
									</td>
									{% if article.estado_publicacion%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{article.id_usuario}}</td>
									<td>{{article.hits}}</td>
									<td>{{article.comments_count}}</td>
									<td>{{article.fecha_publicacion}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="ptable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Hits</th>
									<th style="width: 200px">Comentarios</th>
									<th style="width: 200px">Fecha creación</th>
								</tr>
							</thead>
							<tbody>
								{%for article in published%}
								<tr>
									<td>
										{{article.id_publicacion}}
									</td>
									<td>
										<a class="submitA" rel="external" href="#" aid="{{article.id_publicacion}}">
											{{article.titulo}}
										</a>
									</td>
									{% if article.estado_publicacion%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{article.id_usuario}}</td>
									<td>{{article.hits}}</td>
									<td>{{article.comments_count}}</td>
									<td>{{article.fecha_publicacion}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="uptable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Hits</th>
									<th style="width: 200px">Comentarios</th>
									<th style="width: 200px">Fecha creación</th>
								</tr>
							</thead>
							<tbody>
								{%for article in unpublished%}
								<tr>
									<td>
										{{article.id_publicacion}}
									</td>
									<td>
										<a class="submitA" rel="external" href="#" aid="{{article.id_publicacion}}">
											{{article.titulo}}
										</a>
									</td>
									{% if article.estado_publicacion%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{article.id_usuario}}</td>
									<td>{{article.hits}}</td>
									<td>{{article.comments_count}}</td>
									<td>{{article.fecha_publicacion}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="search" class="tab padding">

						<form id="queryform" action="user_query/" method="POST">
							<table>
								<thead>
									<tr>
										<th style="width: 80px">
											<select name="id_condition">
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 100px">
											<select>
												<option>Nombre</option>
												<option>Apellido</option>
												<option selected="selected">Nombre y Apellido</option>
											</select>
										</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 200px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th>Admin</th>
										<th>Activo</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>
											<input class="query" type="text" name="uid" placeholder="ID"/>
										</td>
										<td style="width:20%;">
											<input class="query" type="text" name="firstname" placeholder="Nombre"/>
										</td>
										<td>
											<input class="query" type="text" name="username" placeholder="Username"/>
										</td>
										<td>
											<input class="query" type="text" name="email" placeholder="Email"/>
										</td>
										<td>
											<input class="query" type="text" name="phone" placeholder="Teléfono"/>
										</td>
										<td>
											<input type="checkbox"/>
										</td>
										<td>
											<input type="checkbox"/>
										</td>
										<td>

										</td>
									</tr>
								</tbody>
							</table>
							<input class="query" id="date" type="text" style="width:100px; float:right; margin-top:-40px; margin-right:10px;" placeholder="Fecha registro"/>
							<input class="runquery"  type="submit" value="Buscar" id="submit"/>
						</form>

						<button id="hide" is-hidden="no" >
							<img id="toggle" src="../../static/images/toggleA.png">
						</button>

						<script type="text/javascript">
						$("#hide").click(function(){
							$("#queryform").delay(200).slideToggle();
							if($(this).attr("is-hidden")=='yes'){
								$(this).attr("is-hidden","no");
								$("#toggle").attr("src","../../static/images/toggleA.png");
							}else{
								$("#toggle").attr("src","../../static/images/toggleB.png");
								$(this).attr("is-hidden","yes");
							}
						});
						</script>

						<table>
							<thead>
								<tr>
									<th></th>
									<th>ID</th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in queryset%}
								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitA" rel="external" href="#" uid="{{user.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td>{{user.id}}</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
								<script>
								$("a.submitA").bind("tap",function() {
									$("#aid").attr("value",$(this).attr("aid"))
									$("form#selectArticle").submit();
								});
								</script>
							</tbody>
						</table>

					</div>
				</div>
			</div>
			<div class="section padding" title="Agregar Articulo - Dashboard" id="editor">
				<div class="carton container border">
					<div class="column">
						<h2 class="infobox glyph write" style="width:83%; margin-left:5%">Agregar un nuevo artículo</h2>
						<form enctype="multipart/form-data" id="addarticle" class="content" action="addArticle/" method="POST">
							<div style="border-bottom:1px solid #9EABAB">
								<input type="hidden" name="usuario" value="{{user.id}}"/>
								<p class="combine">
									<input id="tittle" name="title" type="text" placeholder="Titulo" />
									<label style="margin-left:20px">Publicado</label>
									<input type="checkbox" name="status" class="grey" />
								</p>
							</div>
							<div id="editor-textarea"></div>
							<label>Tags:</label>
							<input id="tags" name="tags" type="text" value="" />
							<textarea placeholder="Resumen" name="abstract"></textarea>
							<input class="lime" type="submit" value="Agregar" />
						</form>
					</div>
					<div id="editor-preview" class="column right"></div>
				</div>
			</div>
			<div class="section padding" title="Editar Articulo - Dashboard" id="aedit">
				<div class="carton container border">
					<div class="column">
						{%if aedit%}
						<form id="deleteForm" action="deleteArticle/">
							<h2 class="infobox glyph write" style="width:83%; margin-left:5%">
								<p class="test">
									Editar el artículo: {{aedit.titulo}}
								</p>(id {{aedit.id_publicacion}})
								<input type="hidden" id="confirmDelete" name="delete"/>
								<input type="submit" value="Eliminar artículo" class="cancel delete" id="delete"/>
								<input type="submit" value="Volver" class="cancel" id="goback"/>
							</h2>
							<script type="text/javascript">
							$('#delete').click(function(){
								$('#confirmDelete').attr('value','True');
								$('form#deleteForm').submit();
							});
							</script>
						</form>
						<form enctype="multipart/form-data" id="editarticle" class="content" action="updateArticle/" method="POST">
							<div style="border-bottom:1px solid #9EABAB">
								<p class="combine">
									<input id="tittle" name="title" type="text" placeholder="Titulo" value="{{aedit.titulo}}" />
									<label style="margin-left:20px">Publicado</label>
									{% if aedit.estado_publicacion%}
									<input type="checkbox" checked="true" name="status" class="grey" />
									{%else%}
									<input type="checkbox" name="status" class="grey" />
									{%endif%}
								</p>
							</div>
							<span id="content" data="{{aedit.contenido}}"></span>
							<div id="editor-utextarea"></div>
							<label>Tags:</label>
							<input id="tags2" type="text" name="tags" value="{{aedit.getTags}}" />
							<textarea placeholder="Resumen" name="abstract">{{aedit.resumen_publicacion}}</textarea>
							<input class="lime" type="submit" value="Actualizar" />
						</form>
						{%else%}
						<p class="infobox glyph warning">
							Para editar un artículo da clic en el titulo del articulo
							<img class="shadow-pic" src="../../static/images/article_help.png"/>
						</p>
						{%endif%}
					</div>
					{%if aedit%}
					<div id="editor-upreview" class="column right"></div>
					<script type="text/javascript">
					$.editor(undefined, "#editor-utextarea", "#editor-upreview",$('#content').attr('data'));
					$.change("#aedit");
					</script>
					{%endif%}
				</div>
			</div>

			<div class="section padding" title="Estadísticas Foros - Dashboard" id="forum_stats">
				<form id="selectForum" action="getForum">
					<input id="fid" type="hidden" name="fid"/>
				</form>
				<ul class="tabs">
					<li id="utablelink" class="count current">
						<a href="#ftable" data-count="{{forums.count}}">Total de Foros</a>
					</li>
					<li class="count">
						<a href="#rftable" data-count="{{recents.count}}">Foros recientes</a>
					</li>
					<li class="count">
						<a href="#pftable" data-count="{{published.count}}">Foros Activos</a>
					</li>
					<li class="count">
						<a href="#upftable" data-count="{{unpublished.count}}">Foros Cerrados</a>
					</li>
					<li id="qtablelink">
						<a href="#search">Buscar</a>
					</li>
					{%if renderquery%}
					<script type="text/javascript">
					$("#utablelink").removeClass("current");
					$("#qtablelink").addClass("current");
					</script>
					{%endif%}
				</ul>
				<div class="tabs">
					<div id="ftable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Aportes</th>
									<th style="width: 200px">Fecha creación</th>
									<th style="width: 200px">Fecha cierre</th>
								</tr>
							</thead>
							<tbody>
								{%for forum in forums%}
								<tr>
									<td>
										{{forum.id_foro}}
									</td>
									<td>
										<a class="submitF" rel="external" href="#" fid="{{forum.id_foro}}">
											{{forum.titulo_foro}}
										</a>
									</td>
									{% if forum.estado_foro%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{forum.id_usuario}}</td>
									<td>{{forum.contribs_count}}</td>
									<td>{{forum.fecha_apertura}}</td>
									{%ifequal forum.fecha_cierre None%}
									<td>Foro no cerrado aún</td>
									{%else%}
									<td>{{forum.fecha_cierre}}</td>
									{%endifequal%}
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="rftable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Aportes</th>
									<th style="width: 200px">Fecha creación</th>
									<th style="width: 200px">Fecha cierre</th>
								</tr>
							</thead>
							<tbody>
								{%for forum in recents%}
								<tr>
									<td>
										{{forum.id_foro}}
									</td>
									<td>
										<a class="submitF" rel="external" href="#" fid="{{forum.id_foro}}">
											{{forum.titulo_foro}}
										</a>
									</td>
									{% if forum.estado_foro%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{forum.id_usuario}}</td>
									<td>{{forum.contribs_count}}</td>
									<td>{{forum.fecha_apertura}}</td>
									{%ifequal forum.fecha_cierre None%}
									<td>Foro no cerrado aún</td>
									{%else%}
									<td>{{forum.fecha_cierre}}</td>
									{%endifequal%}
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="pftable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Aportes</th>
									<th style="width: 200px">Fecha creación</th>
								</tr>
							</thead>
							<tbody>
								{%for forum in published%}
								<tr>
									<td>
										{{forum.id_foro}}
									</td>
									<td>
										<a class="submitF" rel="external" href="#" fid="{{forum.id_foro}}">
											{{forum.titulo_foro}}
										</a>
									</td>
									{% if forum.estado_foro%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{forum.id_usuario}}</td>
									<td>{{forum.contribs_count}}</td>
									<td>{{forum.fecha_apertura}}</td>
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="upftable" class="tab padding">
						<table>
							<thead>
								<tr>
									<th>ID</th>
									<th style="width: 200px">Titulo</th>
									<th style="width: 200px">Publicación</th>
									<th style="width: 200px">Autor</th>
									<th style="width: 200px">Aportes</th>
									<th style="width: 200px">Fecha creación</th>
									<th style="width: 200px">Fecha cierre</th>
								</tr>
							</thead>
							<tbody>
								{%for forum in unpublished%}
								<tr>
									<td>
										{{forum.id_foro}}
									</td>
									<td>
										<a class="submitF" rel="external" href="#" fid="{{forum.id_foro}}">
											{{forum.titulo_foro}}
										</a>
									</td>
									{% if forum.estado_foro%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{forum.id_usuario}}</td>
									<td>{{forum.contribs_count}}</td>
									<td>{{forum.fecha_apertura}}</td>
									{%ifequal forum.fecha_cierre None%}
									<td>Foro no cerrado aún</td>
									{%else%}
									<td>{{forum.fecha_cierre}}</td>
									{%endifequal%}
								</tr>
								{%endfor%}
							</tbody>
						</table>
					</div>
					<div id="search" class="tab padding">

						<form id="queryform" action="user_query/" method="POST">
							<table>
								<thead>
									<tr>
										<th style="width: 80px">
											<select name="id_condition">
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 100px">
											<select>
												<option>Nombre</option>
												<option>Apellido</option>
												<option selected="selected">Nombre y Apellido</option>
											</select>
										</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 200px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
										<th>Admin</th>
										<th>Activo</th>
										<th style="width: 120px">
											<select>
												<option>Empiece</option>
												<option>Termine</option>
												<option>Menor</option>
												<option>Mayor</option>
												<option>Contenga</option>
												<option selected="selected">Igual</option>
											</select>
										</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>
											<input class="query" type="text" name="uid" placeholder="ID"/>
										</td>
										<td style="width:20%;">
											<input class="query" type="text" name="firstname" placeholder="Nombre"/>
										</td>
										<td>
											<input class="query" type="text" name="username" placeholder="Username"/>
										</td>
										<td>
											<input class="query" type="text" name="email" placeholder="Email"/>
										</td>
										<td>
											<input class="query" type="text" name="phone" placeholder="Teléfono"/>
										</td>
										<td>
											<input type="checkbox"/>
										</td>
										<td>
											<input type="checkbox"/>
										</td>
										<td>

										</td>
									</tr>
								</tbody>
							</table>
							<input class="query" id="date" type="text" style="width:100px; float:right; margin-top:-40px; margin-right:10px;" placeholder="Fecha registro"/>
							<input class="runquery"  type="submit" value="Buscar" id="submit"/>
						</form>

						<button id="hide" is-hidden="no" >
							<img id="toggle" src="../../static/images/toggleA.png">
						</button>

						<script type="text/javascript">
						$("#hide").click(function(){
							$("#queryform").delay(200).slideToggle();
							if($(this).attr("is-hidden")=='yes'){
								$(this).attr("is-hidden","no");
								$("#toggle").attr("src","../../static/images/toggleA.png");
							}else{
								$("#toggle").attr("src","../../static/images/toggleB.png");
								$(this).attr("is-hidden","yes");
							}
						});
						</script>

						<table>
							<thead>
								<tr>
									<th></th>
									<th>ID</th>
									<th>Nombre</th>
									<th>Username</th>
									<th style="width: 200px">Email</th>
									<th style="width: 200px">Activo</th>
									<th style="width: 200px">Admin</th>
									<th style="width: 200px">Teléfono</th>
									<th style="width: 200px">Miembro desde</th>
								</tr>
							</thead>
							<tbody>
								{%for user in queryset%}
								<tr>
									<td class="utable">
										<ul>
											<li class="avatar"><a class="submitF" rel="external" href="#" fid="{{forum.id}}"><img src="../../static/{{user.avatar}}" alt="avatar"/></a></li>
										</ul>
									</td>
									<td>{{user.id}}</td>
									<td style="width:20%;">{{user.first_name}}  {{user.last_name}}</td>
									<td>{{user.username}}</td>
									<td>{{user.email}}</td>
									{% if user.is_active%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									{% if user.is_superuser%}
									<td><input  disabled="disabled" checked="true" type="checkbox"/></td>
									{%else%}
									<td><input  disabled="disabled" type="checkbox"/></td>
									{%endif%}
									<td>{{user.phone}}</td>
									<td>{{user.date_joined}}</td>
								</tr>
								{%endfor%}
								<script>
								$("a.submitF").bind("tap",function() {
									$("#fid").attr("value",$(this).attr("fid"))
									$("form#selectForum").submit();
								});
								</script>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="section padding" title="Agregar Foro - Dashboard" id="add_forum">
				<div class="carton container border">
					<div class="column">
						<h2 class="infobox glyph message" style="width:83%; margin-left:5%">Agregar un nuevo foro</h2>
						<form enctype="multipart/form-data" id="addForum" class="content" action="addForum/" method="POST">
							<div style="border-bottom:1px solid #9EABAB">
								<input type="hidden" name="usuario" value="{{user.id}}"/>
								<p class="combine">
									<input id="tittle" name="title" type="text" placeholder="Titulo" />
									<label style="margin-left:20px">Publicado</label>
									<input type="checkbox" name="status" class="grey" />
								</p>
							</div>
							<textarea placeholder="Descripción" name="description"></textarea>
							<input class="lime" type="submit" value="Agregar" />
						</form>
					</div>
				</div>
			</div>
			<div class="section padding" title="Editar Foro - Dashboard" id="edit_forum">
				<div class="carton container border">
					<div class="column">
						{%if fedit%}
						<form id="deleteForm2" action="deleteForum/">
							<h2 class="infobox glyph write" style="width:83%; margin-left:5%">
								<p class="test">
									Editar el foro: {{fedit.titulo_foro}}
								</p>(id {{fedit.id_foro}})
								<input type="hidden" id="confirmDelete" name="delete"/>
								<input type="submit" value="Eliminar foro" class="cancel delete" id="delete"/>
								<input type="submit" value="Volver" class="cancel" id="goback"/>
							</h2>
							<script type="text/javascript">
							$('#delete').click(function(){
								$('#confirmDelete').attr('value','True');
								$('form#deleteForm').submit();
							});
							</script>
						</form>
						<form enctype="multipart/form-data" id="editForum" class="content" action="updateForum/" method="POST">
							<div style="border-bottom:1px solid #9EABAB">
								<p class="combine">
									<input id="tittle" name="title" type="text" placeholder="Titulo" value="{{fedit.titulo_foro}}" />
									<label style="margin-left:20px">Publicado</label>
									{% if fedit.estado_foro%}
									<input type="checkbox" checked="true" name="status" class="grey" />
									{%else%}
									<input type="checkbox" name="status" class="grey" />
									{%endif%}
								</p>
							</div>
							<textarea placeholder="Descripción" name="description">{{fedit.descripcion}}</textarea>
							<input class="lime" type="submit" value="Actualizar" />
						</form>
						{%else%}
						<p class="infobox glyph warning">
							Para editar un foro da clic en el titulo del foro
							<img class="shadow-pic" src="../../static/images/forums_help.png"/>
						</p>
						{%endif%}
					</div>
					{%if aedit%}
					<div id="editor-upreview" class="column right"></div>
					<script type="text/javascript">
					$.editor(undefined, "#editor-utextarea", "#editor-upreview",$('#content').attr('data'));
					$.change("#aedit");
					</script>
					{%endif%}
				</div>
			</div>

		</div>
	</div>
	<div id="footer">
		<div class="con">
			<h4>Pastel</h4>
		</div>
	</div>
</body>
</html>